﻿@model Woobao.VO.VOCampeonato
@using Woobao.VO;

@{
    ViewBag.Title = "Novo Campeonato";
    Layout = "~/Views/Shared/_Layout.cshtml";

    List<VOStatus> listaStatus = ViewBag.ListaDeStatus;
    
}

<h2>Crie o seu novo Campeonato!</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Campeonato</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nome)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nome)
            @Html.ValidationMessageFor(model => model.Nome)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DtInicio, "Data Inicial")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DtInicio)
            @Html.ValidationMessageFor(model => model.DtInicio)
        </div>
           
        <div class="editor-label">
            @Html.LabelFor(model => model.CodigoStatus, "Status")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(Model => Model.CodigoStatus, listaStatus.Select(q => new SelectListItem() { Text = q.Descricao, Value = q.Codigo.ToString()}))    @*Select no status*@
            @*Html.EditorFor(model => model.CodigoStatus)  Colocar um if*@
            @Html.ValidationMessageFor(model => model.CodigoStatus)
            
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NumeroParticipantes, "Número de Participantes")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NumeroParticipantes)
            @Html.ValidationMessageFor(model => model.NumeroParticipantes)
        </div>

        <p>
            <input type="submit" value="Criar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
